<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="sp" uri="http://www.springframework.org/tags"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>My JSP 'add.jsp' starting page</title>

<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3" />
<meta http-equiv="description" content="This is my page" />
<style type="text/css">
#tr_upload td {
	display: none;
	visibility: hidden;
}
</style>
</head>

<body class="mainframe">
  <form action="/admin/product/edit.dhtml" method="post">
    <input type="hidden" name="product.id" value="<c:out value="${product.id}" />" />
    <table class="admin_table">
      <caption>修改产品</caption>
      <c:choose>
        <c:when test="${message.info != null }">
          <tr>
            <td colspan="2"><sp:message code="${message.info}" text="" /></td>
          </tr>
        </c:when>
        <c:otherwise>
          <tr>
            <td>产品名称</td>
            <td><input type="text" id="productName" name="product.name" /><span id="productNameTip"></span></td>
          </tr>
          <tr>
            <td>品牌</td>
            <td><input type="text" id="productBrand" name="product.brand" /></td>
          </tr>
          <tr>
            <td>产品描述</td>
            <td><textarea id="productDescription" name="product.description" rows="4" cols="100"></textarea></td>
          </tr>
          <tr>
            <td>产品图片</td>
            <td><input type="text" id="productImg" name="product.img" /></td>
          </tr>
          <tr>
            <td>关键词</td>
            <td><input type="text" id="productKeyword" name="product.keyword" /></td>
          </tr>
          <tr>
            <td>制造商</td>
            <td><input type="text" id="productManufacturer" name="product.manufacturer" /></td>
          </tr>
          <tr>
            <td>价格</td>
            <td><input type="text" id="productPrice" name="product.price" /></td>
          </tr>
          <tr>
            <td>产地</td>
            <td><input type="text" id="productProdarea" name="product.prodarea" /></td>
          </tr>
          <tr>
            <td>唯一码</td>
            <td><input type="text" id="productUniqueCode" name="product.uniqueCode" /></td>
          </tr>
          <tr>
            <td>是否前台显示</td>
            <td><input type="text" id="productUseFlag" name="product.useFlag" /></td>
          </tr>

          <tr>
            <td></td>
            <td><input type="submit" id="productSubmit" value="添加" class="button01" /></td>
          </tr>
        </c:otherwise>
      </c:choose>
    </table>
  </form>
  <script type="text/javascript" src="/js/ckeditor/ckeditor.js"></script>
  <script type="text/javascript">
			CKEDITOR.replace("productContent");

			// 表单验证
			var formCheck = $.formCheck();
			formCheck.regAllEmpty("productName", {
				onShow : "输入目录名称",
				onFocus : "此项为必填",
				onError : "此项为必填",
				onCorrect : "目录名称输入正确"
			}, true);
			formCheck.formCheck("productCateForm");
		</script>
</body>
</html>